package com.woniu.controller;

import com.woniu.entity.Result;
import com.woniu.entity.vo.HelpCenterVO;
import com.woniu.pojo.HelpCenter;
import com.woniu.service.HelpCenterService;
import com.woniu.utils.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Ma.Lei
 * @description
 * @date 2022/12/30 10:34
 */
@RestController
@RequestMapping("/helpCenter")
@Api(tags = "帮助中心控制类")
public class HelpCenterController extends BaseController {

    @Autowired
    private HelpCenterService helpCenterService;

    @ApiOperation("问题列表")
    @GetMapping("/listQuestion")
    public Result listQuestion(){
        List<HelpCenterVO> helpCenterVOList = helpCenterService.listQuestion();
        return toDataResult(helpCenterVOList);
    }
    @ApiOperation("问题详情")
    @GetMapping("/selectQuestionById/{id}")
    public Result selectQuestionById(@PathVariable String id){
        HelpCenter helpCenter = helpCenterService.getById(id);
        return toDataResult(helpCenter);
    }
}
